﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RakutenCrawler.Repository
{
    public class SchedulerRepository:GenericRepository<Scheduler>
    {
        public override void InsertOrUpdate(Scheduler item)
        {
            var check = Single(s => s.LinkConfigGuid == item.LinkConfigGuid);
            if (check == null)
            {
                All.AddObject(item);
            }
            else
            {
                item.SchedulerId = check.SchedulerId;
                All.ApplyCurrentValues(item);
            }

        }
    }
}
